﻿using System.Collections.Generic;

namespace FamilyBook.Core.Repositories
{
    public interface IGeneralRepository<TEntity, in TEntityId> where TEntity : class
    {
        TEntity Create(TEntity entityInstance);
        TEntity Read(TEntityId entityId);
        bool TryRead(TEntityId entityId, out TEntity entityInstance);
        IEnumerable<TEntity> ReadAll();
        void Update(TEntity entityInstance);
        void Delete(TEntity entityInstance);
        void Delete(TEntityId entityId);
    }
}